package com.rd.student.jike.class1.fangzhou.day0731;

import java.util.Random;

public class Test02 {
    public static void main(String[] args) {
        int[] arr = new int[50];
        int[] result = new int[20];
        Random rd = new Random();
        for(int i = 0; i<20;){
            int num = rd.nextInt(50);
            if(arr[num]==0){
                arr[num] = 1;
                result[i++] = num;
            }
        }
        for(int k = 0;k< result.length;k++){
            System.out.print(result[k]+" ");
        }
    }
}
